package reduce.fz.com.reduce.fragment;


import android.os.Bundle;
import android.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import java.util.HashMap;

import de.greenrobot.event.EventBus;
import reduce.fz.com.reduce.R;
import reduce.fz.com.reduce.custom.SanItem;
import reduce.fz.com.reduce.display.Display;
import reduce.fz.com.reduce.display.MainDisplay;
import reduce.fz.com.reduce.event.DoorFragmentShowEvent;
import reduce.fz.com.reduce.event.FragmentEnum;
import reduce.fz.com.reduce.fragment.base.BaseFragment;
import reduce.fz.com.reduce.util.ToastUtil;

/**
 * A simple {@link Fragment} subclass.
 */
public class MessageFragment extends BaseFragment implements View.OnClickListener {

    private SanItem jianzhengItem;
    private SanItem fensiItem;
    private SanItem tuijianItem;

    public MessageFragment() {
    }

    public static MessageFragment create()
    {
        MessageFragment fragment=new MessageFragment();
        return fragment;
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view= inflater.inflate(R.layout.fragment_message, container, false);
        initWidget(view);
        return view;
    }

    public void initWidget(View view) {
        jianzhengItem = (SanItem) view.findViewById(R.id.rl_jianzheng);
        fensiItem = (SanItem)view.findViewById(R.id.rl_fensi);
       // tuijianItem= (SanItem) view.findViewById(R.id.rl_tuijian);
        jianzhengItem.setContent(R.drawable.icon_jianzheng,"见证",R.drawable.icon_jinru);
        fensiItem.setContent(R.drawable.icon_fensi,"粉丝",R.drawable.icon_jinru);
        jianzhengItem.setOnClickListener(this);
        fensiItem.setOnClickListener(this);
    }


    @Override
    public void onClick(View view) {
      switch (view.getId())
      {
          case R.id.rl_jianzheng:
             EventBus.getDefault().post(new DoorFragmentShowEvent<HashMap>(FragmentEnum.JIANZHENGFRAGMENT,null));
              break;
          case R.id.rl_fensi:
              EventBus.getDefault().post(new DoorFragmentShowEvent<HashMap>(FragmentEnum.FENSIFRAGMENT,null));
              break;
          default:
              break;

      }
    }
}
